//栏目管理
import request from "@/api/request.js";

export const addColService = DataObj => {
  return request.post("/api-self/admin_panel/category", DataObj);
};

export const delColService = categoryId => {
  return request.delete(`/api-self/admin_panel/category/${categoryId}`);
};

export const editColService = DataObj => {
  let url = `/api-self/admin_panel/category/${DataObj.categoryId}`;
  let Data = {
    categoryName: DataObj.categoryName,
    description: DataObj.description
  };
  return request.put(url, Data);
};

export const getAllColService = () => {
  return request.get("/api-self/admin_panel/getcategory");
};
